#ifndef GRAPHICS_H
#define GRAPHICS_H

#include <QtGui>
#include <vector>
#include "mathbox.h"

struct FunctionValue
{
	FunctionValue(const double argument, const double value)
		: argument(argument)
		, value(value)
	{}
	double argument, value;
};

class Graphics : public QWidget
{
	Q_OBJECT

public:
	Graphics(QWidget *parent = 0);
	~Graphics();

	QSize minimumSizeHint() const;
    QSize sizeHint() const;
	int heightForWidth (int w) const;

public slots:
     void addValue(const GraphicData& data);

 protected:
    void paintEvent(QPaintEvent *event);
	void timerEvent(QTimerEvent *event);

private:
	std::vector<GraphicData> graphicData;
	double secondsToShow;
	double maxValueToShow;
};

#endif // GRAPHICS_H
